package com.yellowpage.bigdata.service;

import java.util.List;
import java.util.Map;

import com.yellowpage.white.common.PageRender;
import com.yellowpage.white.dao.QueryAssistantSQL;
import com.yellowpage.white.service.BaseServiceImpl;

import com.yellowpage.bigdata.dao.NspFatallogHuaweiDaynumHotEntityDao;

public class NspFatallogHuaweiDaynumHotEntityServiceImpl extends BaseServiceImpl implements NspFatallogHuaweiDaynumHotEntityService {
    private NspFatallogHuaweiDaynumHotEntityDao nspFatallogHuaweiDaynumHotEntityDao;

    public void setNspFatallogHuaweiDaynumHotEntityDao(NspFatallogHuaweiDaynumHotEntityDao nspFatallogHuaweiDaynumHotEntityDao) {
        this.nspFatallogHuaweiDaynumHotEntityDao = nspFatallogHuaweiDaynumHotEntityDao;
    }

    public List<Map> queryNspFatallogHuaweiDaynumHotEntityByPage(Map queryMap, PageRender pageRender) {
        String logDate = queryMap.get("logDate").equals("") ? "" : " and LOG_DATE = " + queryMap.get("logDate");
        String order = " order by a.HOT desc";
        QueryAssistantSQL sqlAssistant = baseDao.newQueryAssistantSQL(
                "SELECT a.SUBJECT_NUM , a.HOT , a.IS_VALUE , a.CREATE_USER , a.CREATE_TIME , a.FATALLOG_HUAWEI_DAYNUM_HOT_ID , a.LOG_DATE    FROM NSP_FATALLOG_HUAWEI_DAYNUM_HOT a WHERE 1=1 " + logDate + order);
        List<Map> resultList = sqlAssistant.queryByPage(
                baseDao.getConnection(), queryMap, pageRender);

        return resultList;
    }
}	